<?php echo $this->BlkHotNews();?>

<div class="content margin-top-20">
    <div class="group-new02 width-100">
        <div class="group-new02-title">
            <div class="sub-left color-main">
                <a class="link-sub" href="#"><img src="<?php echo $this->imgUrl; ?>/icons/icon-flower.png" alt=""  /></a>
                <p>Tin Tức</p>
            </div>
        </div>
        <div class="group-new02-box">
            <?php
            $ssFilter = $view->arrParam['ssFilter'];
			$langTmp = $ssFilter['lang'];
			if($langTmp == ''){
				$langTmp = 'vi';
			}else{
				$langTmp = $ssFilter['lang'];
			}
            
            $tblCut     = new Zendvn_File_CutTring();
            $news   = $this->Items;
            
            
            foreach($news as $ns){
            	$nsId		= $ns['id'];
            	$nsName		= $ns['alias'];
                $nsTitle    = $tblCut->cutTring('150', $ns['name'], null);
                $nsSummary  = $tblCut->cutTring('300', $ns['summary'], null);
                $realLink   = FILES_PATH. '/news/images450x450/' . $ns['picture'];
                    if(!empty($ns['picture'])){
                        if(file_exists($realLink)){
                            $linkImg	= FILES_URL . '/news/images450x450/' . $ns['picture'];
                        }
                        else{
                            $linkImg	= FILES_URL . '/news/images450x450/no-image.jpg';
                        }
                        $picture 	= '<img title="'. $nsTitle .'" src="'. $linkImg .'" width="220" height="120" alt="'.$nsTitle.'" />';
                    }
                    else{
                        $linkImg	= FILES_URL . '/news/images450x450/no-image.jpg';
                        $picture 	= '<img title="'. $nsTitle .'" src="'. $linkImg .'" width="220" height="120" alt="'.$nsTitle.'" />';
                    }
                    
                $urlOptions = array('module'=>'news',
	                               	'controller'=>'index',
	                                'action'=>'detail',
	                                'nname'=>$nsName,
	                                'id'=>$nsId,
	                                'lang'=>$langTmp);
                $linkProduct = $this->url($urlOptions,'news-detail');
            ?>
            <div class="box">
                <div class="img"><?php echo $picture; ?></div>
                <div class="text">
                    <a href="<?php echo $linkProduct;?>"><?php echo $nsTitle; ?></a>
                    <p><?php echo $nsSummary; ?></p>
                </div>
                <div class="clear"></div>
            </div>
            <?php } ?>
            <div class="cur-page mar-top-20">
                <?php
                    $paginator = $this->arrParam['paginator'];
                    $itemCountPerPage = $paginator['itemCountPerPage'];
                    if($this->total > $itemCountPerPage){
                        $currentUrl = $this->baseUrl($this->currentController . '/index');
                        echo $this->paginationControl($this->panigator,'Sliding','curentpage.phtml',array('currentUrl'=>$currentUrl,'arrParam'=>$this->arrParam));
                    }
                ?>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>
